<link rel="stylesheet" href="#(path)/assets/plugins/liulan/css/viewer.min.css">
<script type="text/javascript" src="#(path)/assets/plugins/liulan/js/viewer.min.js"></script>
<script type="text/javascript" src="#(path)/assets/js/gridify.js"></script>
<style>
	.pic{float:left;margin:10px;height:auto;}
</style>
<script> 
var id = GetRequest()["id"];
$.getJSON("#(path)/bid/info?token=#(session.token??)&id="+id, function(bidactive) {
	JSON.parse(bidactive.data.detail.cert_info,function(k,v){
		if(k!=""){  
			$("#dowebok").append("<div class='pic'><img style='width:250px;height:auto;' class="+k+" data-original='"+v+"'src='"+v+"' alt='图片"+k+"'></div>");
			if((k-2)%3==0){
				
				var heights = $("#dowebok").height()+400;  
				$("#dowebok").css("height",heights);
				console.log($("#dowebok").height()); 
			}
			
		}else{
			$("#dowebok").css("height","300px;");
		}
		var options =
		{
			srcNode: 'img',             // grid items (class, node)
			margin: '20px',             // margin in pixel, default: 0px
			width: '300px',             // grid item width in pixel, default: 220px
			max_width: '',              // dynamic gird item width if specified, (pixel)
			resizable: true,            // re-layout if window resize
			transition: 'all 0.5s ease' // support transition for CSS3, default: all 0.5s ease
		}
		$('#dowebok').gridify(options);
	}); 

	var viewer = new Viewer(document.getElementById('dowebok'), { 
		url: 'data-original'
	});
		//$("#tradepic").html(bidactive.data.detail.cert_info);
});
function GetRequest() {   
   var url = location.search; //获取url中"?"符后的字串   
   var theRequest = new Object();  
   if (url.indexOf("?") != -1) {  
	  var str = url.substr(1);  
	  strs = str.split("&");   
	  for(var i = 0; i < strs.length; i ++) {  
		 theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);  
	  }  
   }  
   return theRequest;  
}  
</script>

<div style="height:300px;;width:1020px;background:#FFF;" id="dowebok">  
  
</div>




